package customermanagesystem.demo.service;

import customermanagesystem.demo.bean.Customer;
import customermanagesystem.demo.bean.DataTablesOutput;
import customermanagesystem.demo.dao.CustomerMapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerService {
    Logger logger = LoggerFactory.getLogger(CustomerService.class);
    @Autowired
    private CustomerMapper customerMapper;

    public DataTablesOutput queryCustomer(Customer customer,Integer start,Integer length,Integer draw,Integer recordsTotal){
        List<Customer> customers = customerMapper.queryCustomer(customer,start,length);
        return new DataTablesOutput(draw,recordsTotal,recordsTotal,customers);
    }

    public int queryTotalCount(Customer customer){
        return customerMapper.queryTotalCount(customer);
    }

//    public int queryPhoto(Customer customer){
//        return customerMapper.queryTotalCount(customer);
//    }
}
